package design.mode.chapter3.item3.versionPlus;

import design.mode.chapter3.item3.versionPlus.controller.IUserController;
import design.mode.chapter3.item3.versionPlus.controller.UserController;
import design.mode.chapter3.item3.versionPlus.controller.UserControllerProxy;
import design.mode.chapter3.item3.versionPlus.controller.dynamicProxy.MetricsCollectorProxy;

/**
 * @author ZhongMingde on 2021/10/29
 */

public class Main {


    // UserControllerProxy使用举例
    // 因为原始类和代理类实现相同的接口，是基于接口而非实现编程
    // 将UserController类对象替换为UserControllerProxy类对象，不需要改动太多代码
    IUserController userController = new UserControllerProxy(new UserController());


    public static void main(String[] args) {
        MetricsCollectorProxy proxy = new MetricsCollectorProxy();
        IUserController userController = (IUserController) proxy.createProxy(new UserController());
    }


}
